Magnets have a number of applications in industrial and commercial goods. One such application is as a method of joining, locking, or aligning two components together. This is achieved by utilizing the attributes of magnetic fields produced by magnets. These magnetic fields cause magnets with opposing polarities facing each other to attract each other, while the same polarities facing each other repel. Such magnetic fields, regardless of polarity, also attract metallic objects. By utilizing the attractive nature of magnets, locking mechanisms can be built, either by using two magnets, or a magnet and a ferromagnetic material.
One example of such an application would be the magnetic lock on a power cord to a laptop computer, or the small magnets used to close and lock in place the cover for a notebook or tablet computer. In such an application small permanent magnets are used, usually small neodymium magnets, which while exerting a strong magnetic field in comparison to their small size, can be pulled away from each other with relative ease in a perpendicular motion by the user, and hence do not require any external tools or large strain to open.
For applications where a stronger lock or magnetic attractive force is required, usually an electromagnet is used. This is because permanent magnets would be too difficult to pull away from each other using human mechanical strength alone. Electromagnets in this case are much more practical, since a simple power button can release the locking mechanism by deactivating the magnetic field and hence attractive forces.